package com.openapi.data;

import exsun.jt808.data.base.JT808Category;
import exsun.jt808.data.distribute_data.DistributeEntity;
import exsun.jt808.data.distribute_data.jt808.QueryServerTimeResponse;
import lombok.Data;

@Data
public class JT808PushData<T extends DistributeEntity>{
    public JT808PushData(Integer msgId, byte[] body, T object){
        init(msgId, body, object, JT808Category.platformProactive);
    }

    public JT808PushData(Integer msgId, byte[] body, T object, JT808Category jt808Category){
        init(msgId, body, object, jt808Category);
    }

    public void  init(Integer msgId, byte[] body, T object, JT808Category jt808Category){
        this.body = body;
        this.object = object;
        this.object.msgId = msgId;
        this.jt808Category = jt808Category;
        this.object.versionId = object.versionId;

    }
    /**
     * 消息体
     */
    public byte[] body;

    /**
     * 消息类别
     */
    public JT808Category jt808Category;

    public T object;
}
